Basic analysis of Vancouver weather patterns:
Data is collected from Govt of Canada website:
(process is automated in ‘van-weather-import.R’)
## [1] "Winter" "Spring" "Summer" "Fall"
Earliest date: 1988-01-01
Most recent date: 2019-10-19
Check data structure:
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 11612 obs. of 10 variables:
## $ Month : Factor w/ 12 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Season : Factor w/ 4 levels "Winter","Spring",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Date : Date, format: "1988-01-01" "1988-01-02" ...
## $ Year : Factor w/ 32 levels "1988","1989",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Day : num 1 2 3 4 5 6 7 8 9 10 ...
## $ Max.Temp : num 3.2 2.5 5.2 3.3 4.3 4.5 5.7 5 6.8 7 ...
## $ Min.Temp : num -0.9 -2 -1.5 0 1.7 1.7 2.7 1.2 2.1 4.7 ...
## $ Mean.Temp : num 1.2 0.3 1.9 1.7 3 3.1 4.2 3.1 4.5 5.9 ...
## $ Total.Precip: num 0 0 0 0 0 0 0 5.6 2.4 0 ...
## $ Season.Yr : num 1988 1988 1988 1988 1988 ...
## - attr(*, "spec")=
## .. cols(
## .. Month = col_double(),
## .. Season = col_character(),
## .. Date = col_date(format = ""),
## .. Year = col_double(),
## .. Day = col_double(),
## .. Max.Temp = col_double(),
## .. Min.Temp = col_double(),
## .. Mean.Temp = col_double(),
## .. Total.Precip = col_double(),
## .. Season.Yr = col_double()
## .. )
Earliest date: 1988-01-01
Most recent date: 2019-10-19
Check Data Relationships
For each month, what has been the pattern in precipitation over the years?
Note: the year for a winter season is applied to year at end of season. So winter from Dec 2018 to Feb 2019 is considered winter of 2019.
##
## Call:
## lm(formula = mean.mean ~ ynum, data = vw.temp.yr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.05622 -0.45445 -0.02806 0.49582 1.08036
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 18.051768 27.580534 0.655 0.519
## ynum -0.003263 0.013763 -0.237 0.815
##
## Residual standard error: 0.5741 on 23 degrees of freedom
## Multiple R-squared: 0.002437, Adjusted R-squared: -0.04093
## F-statistic: 0.0562 on 1 and 23 DF, p-value: 0.8147
Model interpretation:
Linear modelling for max and min
##
## Call:
## lm(formula = mean.max ~ ynum, data = vw.temp.yr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.20519 -0.37770 -0.07791 0.44992 1.25842
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 21.17014 30.31711 0.698 0.492
## ynum -0.00328 0.01513 -0.217 0.830
##
## Residual standard error: 0.631 on 23 degrees of freedom
## Multiple R-squared: 0.00204, Adjusted R-squared: -0.04135
## F-statistic: 0.04702 on 1 and 23 DF, p-value: 0.8303
Model interpretation:
##
## Call:
## lm(formula = mean.min ~ ynum, data = vw.temp.yr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.89768 -0.44617 0.00104 0.51939 0.86951
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 13.911637 27.023795 0.515 0.612
## ynum -0.002766 0.013485 -0.205 0.839
##
## Residual standard error: 0.5625 on 23 degrees of freedom
## Multiple R-squared: 0.001825, Adjusted R-squared: -0.04157
## F-statistic: 0.04206 on 1 and 23 DF, p-value: 0.8393
Model interpretation:
For each month, what has been the pattern in ave. temperature over the years?
Note: the year for a winter season is applied to year at end of season. So winter from Dec 2018 to Feb 2019 is considered winter of 2019.